﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Data.SqlTypes;
namespace Dao
{
    class confactory
    {
        private static string constr = conString.connstr;
        public static SqlConnection getcon() {
            return creaton();
        }
        public static SqlConnection creaton() {
            SqlConnection conn = new SqlConnection();
            return conn;

        }
        public static void openconn(SqlConnection conn) {
            if (conn!=null&&conn.State==System.Data.ConnectionState.Closed)
            {
                conn.Open();
            }
        }
        public static void closeconn(SqlConnection conn)
        {
            if (conn != null && conn.State == System.Data.ConnectionState.Open)
            {
                conn.Close();
            }
        }
    }
}
